<template>
  <div class="carbonsink">
    <pieChart :pieData="dataArr" />
  </div>
</template>

<script>
import pieChart from "@/views/home/carbonsink/components/pieChart.vue";
export default {
  name: "carbonsink",
  props: {
    activeName: {
      type: String,
      default: "0",
    },
  },
  components: {
    pieChart,
  },
  data() {
    return {
      dataArr: [],
    };
  },
  watch: {
    activeName: {
      handler(val) {
        if (val && val == "1") {
          setTimeout(() => {
            this.getpieData();
          }, 500);
        }
      },
      immediate: true,
      deep: false,
    },
  },
  methods: {
    getpieData() {
      this.dataArr = [
        { value: 0, name: "园区绿化" },
        { value: 0, name: "办公室绿化" },
        { value: 0, name: "楼顶植被" },
        { value: 0, name: "赠面碳汇涂料" },
        { value: 0, name: "公园植被" },
      ];
    },
  },
};
</script>

<style scoped lang="scss">
.carbonsink {
  width: 100%;
}
</style>
